/*
 * $Id: SimpleLoggerConfiguration.java 36 2012-12-28 09:11:40Z vladimirow@mail.ru $
 * $HeadURL: http://ultralog.googlecode.com/svn/ultralog/tags/release-20130123/src/java/com/google/code/ultralog/configuration/SimpleLoggerConfiguration.java $
 *
 * This file is a part of ultralog project (http://code.google.com/p/ultralog/).
 * Released under New BSD License.
 */
package com.google.code.ultralog.configuration;

import com.google.code.ultralog.writer.LogRecordWriter;

/**
 * Simple implementation of {@link LoggerConfiguration} interface that always
 * returns the same minimum logging level and log record writer.
 *
 * @author Mikhail Vladimirov
 */
public class SimpleLoggerConfiguration implements LoggerConfiguration
{
    private final int minimumLoggingLevel;
    private final LogRecordWriter logRecordWriter;

    /**
     * Create new simple logger configuration that returns given minimum
     * logging level and log record writer.
     *
     * @param minimumLoggingLevel minimum logging level to return
     * @param logRecordWriter log record writer to return
     */
    public SimpleLoggerConfiguration (
        int minimumLoggingLevel, LogRecordWriter logRecordWriter)
    {
        if (logRecordWriter == null)
            throw new IllegalArgumentException ("Log record writer is null");

        this.minimumLoggingLevel = minimumLoggingLevel;
        this.logRecordWriter = logRecordWriter;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int getMinimumLoggingLevel ()
    {
        return minimumLoggingLevel;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public LogRecordWriter getLogRecordWriter ()
    {
        return logRecordWriter;
    }
}
